import requests

cities = [
    'Tomsk',
    'Myski',
    'Magadan',
    'Yakutsk',
    'Berlin',
    'Tokyo',
    'Washington'
    'Moscow'
]

def make_url(city):
    return f'http://wttr.in/{city}'

def make_parametrs():
    parametrs = {
        '0': '',
        'M': '',
        'format': '2'
    }
    return parametrs

def what_weather(city):
    try:
        response = requests.get(make_url(city), params=make_parametrs())
        if response.status_code == 200:
            return response.text
        elif response.status_code == 404:
            return 'Server error'
    except response.ConnectionError:
        return 'Connection error'

print('Weather on the cities\n')

for city in cities:
    print(city, what_weather(city))
    
